local cid = arg[1] or "111";
local host, port = "127.0.0.1", 8080
local socket = require("socket")
local tcp = assert(socket.tcp())

tcp:connect(host, port);
data = [[
{"sender":"client","msgtype":"asrequest","cid":"_cid_", "data":"xxx.wav"}
]]
data = string.gsub(data, "_cid_", cid);
--note the newline below
print(">>>>>send:" .. data)
tcp:send(data);

print("start to receive:")
while true do
    local recvMsg, status, partial = tcp:receive()
    print("<<<<<receive:" .. (recvMsg or ""))

    if status == "closed" then break end
end
tcp:close()